using System.Xml.Serialization;
using LinqToDB;
using LinqToDB.Mapping;
using NalogGarLoader.Data.Tables.GarEntries;

namespace NalogGarLoader.Data.Tables.GarEntries.AddressTables;

#nullable disable

[XmlRoot("ROOM")]
[Table(GarTypes.AS_ROOMS)]
public class Room : GarAddressTableEntryBase
{
    [XmlAttribute("ID")]
    [PrimaryKey]
    public long Id { get; set; }

    [XmlAttribute("OBJECTID")]
    [Column]
    public long ObjectId { get; set; }

    [XmlAttribute("OBJECTGUID")]
    [Column]
    public Guid ObjectGuid{ get; set; }      

    [XmlAttribute("CHANGEID")]
    [Column]
    public long ChangeId { get; set; }         

    [XmlAttribute("NUMBER")]
    [Column (DataType = DataType.NVarChar, Length = 50)]
    public string Number { get; set; }                         

    [XmlAttribute("ROOMTYPE")]
    [Column (DataType = DataType.NVarChar, Length = 2)]
    public string RoomType { get; set; }    

    [XmlAttribute("OPERTYPEID")]
    [Column (DataType = DataType.NVarChar, Length = 2)]
    public string OperTypeId { get; set; }        

    [XmlAttribute("PREVID")]
    [Column]
    public long PrevId { get; set; }    

    [XmlAttribute("NEXTID")]
    [Column]
    public long NextId { get; set; }    

    [XmlAttribute(AttributeName = "UPDATEDATE", DataType = "date")]
    [Column(DataType = DataType.Date)]
    public DateTime UpdateDate { get; set; }

    [XmlAttribute(AttributeName = "STARTDATE", DataType = "date")]
    [Column(DataType = DataType.Date)]
    public DateTime StartDate { get; set; }

    [XmlAttribute(AttributeName = "ENDDATE", DataType = "date")]
    [Column(DataType = DataType.Date)]
    public DateTime EndDate { get; set; }

    [XmlAttribute("ISACTIVE")]
    [Column]
    public bool IsActive { get; set; }         

    [XmlAttribute("ISACTUAL")]
    [Column]
    public bool IsActual { get; set; }       
}